package com.example.demo.util;

import javax.servlet.http.HttpSession;
import javax.websocket.HandshakeResponse;
import javax.websocket.server.HandshakeRequest;
import javax.websocket.server.ServerEndpointConfig;


public class getHttpSessionConfigurator extends ServerEndpointConfig.Configurator {


    @Override
    public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
        HttpSession httpSession=(HttpSession) request.getHttpSession();
        //System.out.println(httpSession);
        try {
            sec.getUserProperties().put(HttpSession.class.getName(),httpSession);
        }catch (Exception e){
            System.out.println(1);
        }

    }
}
